package com.spj.jwt;

import io.jsonwebtoken.*;

import java.util.Date;

/**
 * @author :spj
 * @Date:2022/4/13
 * @description:
 */
public class Demo {
    public static void main(String[] args) {
        JwtBuilder jwtBuilder = Jwts.builder().setId("123").setSubject("admin").setIssuedAt(new Date())
                .claim("myname", "spj").claim("mycity", "gy")
                .signWith(SignatureAlgorithm.HS256, "myrbac");
        System.out.println(jwtBuilder.compact());
    }
}
